import { Condition } from './condition';
import { Define, EntityObjectFactory } from 'tiny-entity2';
import { TmpComItem } from './tmpComItem';
const EntityObjectType = EntityObjectFactory.GetEntityObjectType(process.env.dataBaseType || 'mysql');
@Define.Table({ TableName: "template" })
export class Template extends EntityObjectType<Template>{
    @Define.PrimaryKey()
    id: string;

    @Define.Column({
        DataType: Define.DataType.VARCHAR,
    })
    name: string;

    @Define.Column({
        DataType: Define.DataType.BOOL,
    })
    showTitle: boolean;

    @Define.Column({
        DataType: Define.DataType.VARCHAR,
    })
    showMode: string;

    @Define.Column({
        DataType: Define.DataType.VARCHAR,
    })
    permitId: string;

    @Define.Column({
        DataType: Define.DataType.VARCHAR,
    })
    permitName: string;

    @Define.Column({
        DataType: Define.DataType.VARCHAR,
    })
    permitGroupName: string;
    
    @Define.Column({
        DataType: Define.DataType.VARCHAR,
        IsIndex: true
    })
    orgId: string;

    @Define.Column({
        DataType: Define.DataType.BIGINT,
    })
    createTime: number;

    @Define.Column({
        DataType: Define.DataType.JSON
    })
    extends;

    @Define.Mapping({
        Mapping: 'TmpComItem',
        MappingKey: 'templateId'
    })
    tmpComItems: TmpComItem[] = [];

    condition: Condition;
}